Longitudinal Data Analysis

Overview

Definitions

Longitudinal data = data collected from the same individuals or units repeatedly over time.

Data Structure

Long Format

Wide Format

Characteristics

Common Research Questions

Modeling Strategies

Modeling Methods

Method When to use Pros Cons Health-data example
Change-score analysis Compare baseline-to-follow-up change Intuitive; easy to report Noisy; sensitive to measurement error; limited to few time points Compare 6-month weight loss between interventions
ANCOVA (ANOVA & Post-hoc Tests#ANCOVA) Compare one follow-up outcome between groups, adjusting for baseline Simple; interpretable; often more efficient than change scores Usually limited to one follow-up; does not model trajectories Compare 12-month blood pressure by treatment, adjusting for baseline
Repeated-measures ANOVA (ANOVA & Post-hoc Tests) Compare fixed, common time points in a balanced design Simple; familiar Needs near-complete, regularly timed data; assumes sphericity; inflexible with missingness Compare mean HbA1c at baseline, 3, 6, and 12 months
MANOVA (ANOVA & Post-hoc Tests#MANOVA) Treat repeated time points as correlated outcomes Avoids sphericity; models cross-time correlation Often needs complete data; poor fit for many or irregular time points Compare treatment groups on blood pressure at three visits
Mixed-effects models (Linear mixed models) Model repeated or nested outcomes, including irregular visits and incomplete data Models individual trajectories; handles unbalanced data; supports random effects Requires covariance/random-effect choices; inference depends on model and missingness assumptions Estimate patient-specific eGFR decline over time
Generalized estimating equations (GEE) (Generalized Linear Models#Relationship to GEE) Estimate population-average effects for correlated continuous, binary, or count outcomes Robust population-average inference; flexible outcome distributions Does not model individual trajectories; dropout can bias results Estimate the average treatment effect on repeated hypertension status
Structural equation models (SEM) (Structural Equation Models) Model complex relations among observed and latent variables Handles latent constructs; tests direct and indirect paths Specification-sensitive; complex; often needs large samples Model links among latent frailty, inflammation, and disability
Latent growth curve models (Structural Equation Models#Latent Growth Curve Models) Model average and individual change within an SEM framework Estimates growth factors; supports latent variables Needs adequate waves and sample size; specification-sensitive Model cognitive decline using repeated test scores
Transition models Model the current outcome conditional on prior outcomes Captures short-term dependence and state changes Interpretation is history-dependent; less suited to long-term trajectories Model transitions among healthy, prediabetes, and diabetes states
Time-varying Cox models (Survival Analysis#Cox (Proportional Hazards) Model) Relate updated exposures or biomarkers to time-to-event outcomes Uses changing covariates; handles censoring Assumes proportional hazards unless extended; time-dependent confounding may bias estimates Relate updated blood pressure to stroke risk
Joint models (a model for trajectory + a model for survival) Analyze a longitudinal marker and related event time together Links marker trajectory to event risk; accounts for informative dropout Complex; computationally intensive; specification-sensitive Link PSA trajectory to prostate-cancer recurrence
Latent class trajectory models Identify subgroups with distinct longitudinal patterns Finds clinically meaningful trajectory groups; allows heterogeneous trends Class number can be unstable; assignments are probabilistic Identify distinct BMI trajectories from childhood to adulthood

Missing Data Handling

Time Data Handling

Design of time definition

Time is a key design choice in longitudinal analysis. Possible definitions:

Model of time

Time can be modeled as:

Key Model Interpretation

Fixed Effect of Time

Average change in the outcome per unit time.

Group Effect

Difference between groups at the reference time point, often baseline.

Time x Group Interaction

Difference in rate of change between groups.
This is often the most important term when comparing trajectories.

Random Intercept

Allows each subject to have their own baseline level.

Random Slope

Allows each subject to have their own rate of change.

Within-Person Effect & Between-Person Effect

Within-person and between-person effects can differ and should not always be interpreted as the same thing.

Within-Person Effect:

Association between changes within the same person over time.\Example:

When a person's blood pressure increases above their own average, does their risk increase?

Between-Person Effect

Association between differences across people.
Example:

Do people with higher average blood pressure have higher risk than others?

Practical Workflow

  1. Understand the study design.
  2. Define the time scale.
  3. Visualize individual trajectories with spaghetti plot.
  4. Plot group-level mean/smoothed trajectories.
  5. Check missingness patterns.
  6. Decide whether the goal is population-average inference, subject-specific inference, prediction, or trajectory discovery.
  7. Choose the model accordingly.
  8. Fit a simple model first.
  9. Add nonlinear time, interactions, or random slopes if needed.
  10. Check assumptions and model fit.
  11. Interpret time effects and time x group interactions carefully.
  12. Conduct sensitivity analyses for missing data and dropout.

Health Data Examples

Repeated Blood Biomarkers

Question:

Does inflammatory biomarker level increase faster among people who later develop cardiovascular disease?

Possible methods:

Cognitive Decline

Question:

Do APOE-e4 carriers show faster cognitive decline?

Possible methods:

Disease Progression

Question:

What are the common trajectories of kidney function decline?

Possible methods:

Treatment Follow-Up

Question:

Does a treatment reduce blood pressure over repeated follow-up visits?

Possible methods: